package com.cn.qgx428.lazydiary.network.service

import com.cn.qgx428.lazydiary.network.bean.CommonResponse
import com.cn.qgx428.lazydiary.network.bean.PlanDetailResponse
import com.cn.qgx428.lazydiary.network.bean.PlanHistoryClockInResponse
import com.cn.qgx428.lazydiary.network.bean.PlansResponse
import retrofit2.http.*
import rx.Observable
import java.util.*

/**
 * Created by qinguanxiong on 2018/3/11.
 */

interface PlanService{
    @FormUrlEncoded
    @POST("Plan/createPlan")
    fun updateUserInfo(@Field("userId") userId: Int,
                       @Field("planName") planName: String,
                       @Field("planImage") planImage: String,
                       @Field("createTime") createTime: String,
                       @Field("endTime") endTime: String,
                       @Field("status") status: String) : Observable<CommonResponse>

    @GET("Plan/getPlans")
    fun getPlans(@Query("userId") userId: Int):
            Observable<PlansResponse>

    @GET("Plan/deletePlan")
    fun deletePlan(@Query("id") id: Int):
            Observable<CommonResponse>

    @GET("Plan/getPlanDetail")
    fun getPlanDetail(@Query("planId") planId: Int):
            Observable<PlanDetailResponse>

    @FormUrlEncoded
    @POST("Plan/updatePlanDetail")
    fun updatePlanDetail(@Query("planId")planId: Int,
                         @Query("id") id: Int,
                         @Field("content") content: String,
                         @Field("createtime") createTime: String):
            Observable<CommonResponse>

    @GET("Plan/removePlanDetail")
    fun removePlanDetail(@Query("id") id: Int):
            Observable<CommonResponse>

    @GET("Plan/checkClockIn")
    fun checkClockIn(@Query("planId") planId: Int,
                     @Query("time") time: String):
            Observable<CommonResponse>

    @GET("Plan/clockIn")
    fun clockIn(@Query("planId") planId: Int,
                @Query("content") content: String,
                @Query("remark") remark: String,
                @Query("time") time: String):
            Observable<CommonResponse>

    @GET("Plan/historyClockIn")
    fun historyClockIn(@Query("planId") planId: Int):
            Observable<PlanHistoryClockInResponse>
}
